<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const inputFuncStr_common="function aaaa (){console.log('transfer')}"
    const outputFuncStr_common="const a=()=>{console.log('transfer')}"
    function funToES6(str) {
        let reg=/^function (.*)\(\)\{(.*)\}$/;
        return str.replace(reg,`const $1\=\(\)\=\>\{$2\}`)
    }
//    console.log(funToES6(inputFuncStr_common))
    function arrange(str) {
        function execute(){
            console.log(str+"is notified");
        };
        function do1(str1){
            console.log("Start to"+str1);
        }
        return { //返回值对象实质上是一个 我们模块的公有API
            execute:execute
        }
    }
    arrange.prototype.do =function(str1){
        console.log("Start to"+str1);
        return this;
    };
   arrange('William').do('commit').execute()
</script>
</body>
</html>